<template>
    <div>
      <table>
        <tr>
          <th>出勤id</th>
          <th>用户ID</th>
          <th>用户部门</th>
          <th>当天出勤情况</th>
          <th>出勤时间</th>
          <th>下班打卡</th>
        </tr>
        <tr v-for="item in items" :key="item.id">
          <td>{{ item.attendanceId }}</td>
          <td>{{ item.userId }}</td>
          <td>{{ item.userDepartmentId }}</td>
          <td>{{ item.attendanceStatus }}</td>
          <td>{{ item.attendanceTime }}</td>
          <td>{{ item.clockOut }}</td>
        </tr>
      </table>
    </div>
  </template>
  
  <script>
  import axios from 'axios';
  
  export default {
    data() {
      return {
        items: []
      };
    },
    created() {
      axios.get('http://localhost:8080/attendance/getAll')
        .then(response => {
          this.items = response.data;
        })
        .catch(error => {
          console.log(error);
        });
    }
  };
  </script>